const cloud = require('@alipay/faas-server-sdk');
exports.main = async (event, context) => {
  const db = cloud.database();
  const set = event.orderGoods;
  console.log(`set:`, set);
  for (const item of set) {
    const orderDetailResp = await db.collection('mall_order_detail').add({
      data: {
        "title":item.title,
        "description":item.description,
        "image":item.image,
        "orderId":event.orderId,
        "skuId":item.skuId,
        "count":item.count,
        "price":item.price,
        "commet":null
      }
    });
    console.log(`orderDetailResp:`, orderDetailResp);
    }
  return true;
};